package com.map.hashmap;

import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;

public class HashMapItrator {
public static void main(String[] args) {
	LinkedHashMap<Integer, String> hm=new LinkedHashMap<Integer, String>();
	hm.put(101, "deepak");
	hm.put(142, "amit");
	hm.put(153, "zeba");
	System.out.println(hm);
	Set<Integer> key=hm.keySet();
	System.out.println(key);
	Collection<String> value=hm.values();
	System.out.println(value);
	Set s1=hm.entrySet();
	Iterator itr=s1.iterator();
	while(itr.hasNext()){
		Map.Entry keyVal=(Map.Entry)itr.next();
		System.out.println(keyVal.getKey()+"\t"+keyVal.getValue());
		/*if(keyVal.getKey().equals(101)){
			keyVal.setValue("deepak kumar");
		}
		System.out.println(keyVal.getKey()+"\t"+keyVal.getValue());*/
	}
}
}
